package state.util;

import java.io.DataInputStream;
import java.io.IOException;
import java.io.InputStream;

public class TextReader {
  public static String getTextFromFile(String fileName) {
    InputStream is = TextReader.class.getResourceAsStream(fileName);
    DataInputStream dataInputStream = new DataInputStream(is);
    try {
      byte[] data = new byte[dataInputStream.available()];
      dataInputStream.readFully(data);
      return new String(data, "UTF-8");
    } catch (IOException e1) {
      return "";
    }
  }
}
